#include "SentenceBlockNode.h"

#include "Output/Console.h"
#include "ScriptCompiler/Token/Token.h"
#include "ScriptCompiler/AST/TypeNode.h"
#include "ScriptCompiler/AST/AccessLevelNode.h"
#include "ScriptCompiler/AST/ParameterNode.h"
#include "ScriptCompiler/AST/SentenceBlockNode.h"
#include "ScriptCompiler/AST/ExpressionNode.h"

void CSentenceBlockNode::DebugPrint(int32_t InDepth)
{
    if (HaveBrace)
    {
        // print depth
        for (int32_t i = 0; i < InDepth; i++)
        {
            WH::Print(U"\t");
        }

        WH::Print(U"{\n");
    }

    auto ContentDepth = HaveBrace ? InDepth + 1 : InDepth;
    for (auto Sentence : Sentences)
    {
        Sentence->DebugPrint(ContentDepth);

        // WH::Cout()<<";\n";
    }

    if (HaveBrace)
    {
        // print depth
        for (int32_t i = 0; i < InDepth; i++)
        {
            WH::Print(U"\t");
        }
        WH::Print(U"}\n");
    }
}

std::shared_ptr<CScriptToken> CSentenceBlockNode::GetFirstToken()
{
    if (Sentences.size() > 0)
    {
        return Sentences[0]->GetFirstToken();
    }
    else
    {
        return nullptr;
    }
}
